-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix currency display in invoice #970
Fix currency display in invoice #970
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request updates the monetary formatting and display logic. In the MoneyAdapter class, the Changes
Sequence Diagram(s)sequenceDiagram
participant AF as AmountField
participant MA as MoneyAdapter
participant INTL as Intl.NumberFormat
AF->>MA: formatAmount(value, { maximumSignificantDigits })
MA->>INTL: Create formatter (without maximumSignificantDigits)
INTL-->>MA: Return formatted value
MA-->>AF: Return formatted amount
sequenceDiagram
participant IS as InvoiceSummary
participant Data as Monetary Data
participant Render as Renderer
IS->>Data: Retrieve prettyAmount & currency code
Data-->>IS: Return amount details
IS->>Render: Display "prettyAmount currency"
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
shared/features/amount-selector/_components/amount-field/amount-field.tsx (1)
78-78
: LGTM! Consider adding maximumSignificantDigits to USD formatting for consistency.The addition of
maximumSignificantDigits
to currency formatting is good. For consistency, consider applying the same option to USD amount formatting on line 71.Apply this diff to maintain consistent decimal places:
const { amount: formattedUsdAmount } = format({ amount: usdAmount, currency: getCurrency("USD"), + options: { maximumSignificantDigits }, });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
core/kernel/money/money-adapter.ts
(0 hunks)shared/features/amount-selector/_components/amount-field/amount-field.tsx
(1 hunks)shared/features/invoice/sections/invoice-summary.tsx
(2 hunks)
💤 Files with no reviewable changes (1)
- core/kernel/money/money-adapter.ts
🔇 Additional comments (2)
shared/features/invoice/sections/invoice-summary.tsx (2)
50-50
: LGTM! Improved reward amount display.The change improves readability by using
prettyAmount
and clearly separating the amount from its currency code.
125-125
: LGTM! Enhanced total amount display.The change maintains consistency by displaying the currency code after the formatted amount.
Summary by CodeRabbit